﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Duality;
using Duality.Resources;
using OpenTK;

namespace PhoenixCrab.TileEditor
{
    public class MapTilesSnapToGrid : Component, ICmpUpdatable
    {
        public Vector2 TileDimensions { get; set; }

        public void OnUpdate()
        {

            // check to see if all objects here line up
            //Editor should store all map tiles for a section within a TileMapSection gameobject
            //todo

            var u = Scene.Current.ActiveObjects.ToList().FindAll(x => x.Transform.Pos.X % TileDimensions.X != 0);
            var v = Scene.Current.ActiveObjects.ToList().FindAll(y => y.Transform.Pos.Y % TileDimensions.Y != 0);
            var result = u.Union(v);
            


        }
    }
}